var pageii = null;
var grid = null;
$(function() {
	
	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "clientId",
			name : "id",
		}, {
			colkey : "clientComName",
			name : "客户姓名",
		}, {
			colkey : "clientMail",
			name : "客户邮箱",
		}, {
			colkey : "clientPosition",
			name : "客户职位",
		}],
		jsonUrl : rootPath + '/item_resource/client_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		checkValue: "clientId",
		records: "list",
		totalPages: "pages",
		totalRecords: "total",
		pagecode: '10',
		pageNow : 'pageNum'
	});


	$("#ok").click("click", function() {
		cobx_elect();
	});

	$("#search").click("click", function() {
		var sel = $("#billstateid option:selected").val();//获取下拉框数据
		var myv = $("#btime").val();//获取输入框数据
		//放出到input框中
		$("#myValue").val(sel+","+myv);
		var searchParams = $("#myValue").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});

});
function cobx_elect() {
	//获取选择的数据
	var cbox = grid.selectRow()[0];
	window.parent.inser_data(cbox.clientComName,cbox.clientId);
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
	parent.layer.close(index);
}